home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connectio…eloper Series 2005 March / Dev.CD Mar 05.iso / What's New / Technical Notes and Q&As / ADC Reference Library / js / adc031904.js < prev    next >
Encoding:
Text File  |  2003-06-10  |  1.7 KB  |  61 lines

  1. <!--
  2. function visByClass(className, state)
  3. {
  4.     if (document.getElementsByTagName) { //check for obj
  5.          var nodes = document.getElementsByTagName("DIV");
  6.          for (var i = 0;i < nodes.length;i++) {
  7.             var nodeObj = nodes.item(i);
  8.             var attrMax = nodeObj.attributes.length
  9.             for (var j = 0; j < attrMax; j++) {
  10.                 if (nodeObj.attributes.item(j).nodeName == 'class') {
  11.                     if (nodeObj.attributes.item(j).nodeValue == className) {
  12.                         vista = (state) ? 'block'    : 'none';
  13.                         nodeObj.style.display = vista;
  14.                      }
  15.                 }
  16.              }
  17.         }
  18.     }
  19.     var nodes = document.getElementsByTagName("SPAN");
  20.          
  21.     var max = nodes.length
  22.     for (var i = 0;i < max;i++) {
  23.         var nodeObj = nodes.item(i);
  24.         for (var j = 0; j < nodeObj.attributes.length; j++)  {
  25.             if (nodeObj.attributes.item(j).nodeName == 'class') {
  26.                 if (nodeObj.attributes.item(j).nodeValue == className) {
  27.                     vista = (state) ? 'block'    : 'none';
  28.                     nodeObj.style.display = vista;
  29.                  }
  30.             }
  31.         }
  32.     }
  33. }
  34.  
  35.  
  36.     
  37.     
  38.  
  39. // Pop A Window
  40. function MM_openBrWindow(theURL,winName,features) { //v2.0
  41.     window.open(theURL,winName,features);
  42. }
  43.  
  44.  
  45. // Redirect user with the item selected with a drop-down menu
  46. function redirect(categoryName, selectedItem)
  47. {    
  48.     //window.location.href = "http://www.apple.com";
  49.     //alert(categoryName);
  50.     var q = selectedItem.indexOf("WONoSelectionString"); 
  51.     //alert(q);
  52.     if ( q == 0 ) {
  53.         //user selected the first item, so take them back to the page listing all docs
  54.         //you have to somehow pass in the name of the category
  55.         //alert("../" + categoryName + "/" + categoryName + "-date.html");
  56.         window.location.href = "../" + categoryName + "/" + categoryName + "-date.html";
  57.     } else {
  58.         window.location.href = selectedItem;
  59.     }
  60. }
  61. //-->